/**
 * 
 */
package com.jquery.ui.tags.html.accordion;



import com.jquery.ui.core.base.BaseTag;
import com.jquery.ui.core.bean.UIBean;
import com.jquery.ui.core.exception.JqueryUIRuntime;
import com.jquery.ui.tags.beans.html.AccordionHtmlUI;

/**
 * @author linyajun
 * 
 * @date	2013-9-22
 * @description   
 */
public class AccordionTag extends BaseTag {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5552453112287584077L;
	
	private String title;

	
	@Override
	public String getEndTemplate() {
		
		return "public-div2-end.ftl";
	}

	
	@Override
	public String getStartTemplate() {
		
		return "accordion-html-start.ftl";
	}

	
	@Override
	public UIBean getUiBean() {
		AccordionsTag tag=(AccordionsTag)this.getParent();
		if (tag==null) {
			throw new JqueryUIRuntime("can't find AcordionsTag");
		}
		if (!(tag instanceof AccordionsTag)) {
			throw new JqueryUIRuntime("accordion parent's tag is not AcordionsTag");
		}
		AccordionHtmlUI ui=new AccordionHtmlUI();
		ui.setId(getId());
		ui.setTitle(title);
		return ui;
	}


	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}


	/**
	 * @param title the titl e to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	

	

}
